package com.dd.poetry.ui.home

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.dd.common.base.BaseSubscriber
import com.dd.poetry.bean.AppSettings
import com.dd.poetry.net.MainBaseViewModel

class HomeViewModel : MainBaseViewModel() {
    private val _appSettings = MutableLiveData<List<AppSettings>>()
    val appSettings: LiveData<List<AppSettings>> = _appSettings

    //==============================================================================================
    fun checkActivity() {
        builder(
            getApi().getAppSetting("10"),
            object : BaseSubscriber<List<AppSettings>>(this, false) {
                override fun onNext(settings: List<AppSettings>) {
                    _appSettings.apply {
                        value = settings
                    }
                }
            })
    }
}